﻿using InCom.SyncStatus;
using InCom.Utilities.Pool;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InCom.Core.SyncInteractive
{
    /// <summary>
    /// 数据同步指令实体
    /// </summary>
    public class SyncCommandEntity
    {
        /// <summary>
        /// 终端编号,如果不是与终端交互的指令则此字段无效
        /// </summary>
        public uint TerminalCode { get; set; }


        /// <summary>
        /// 发送或者设置的当前数据实体
        /// </summary>
        public InCom.Utilities.Protocol.BaseTcpProtocolEntity Protocol { get; set; }
        /// <summary>
        /// 当前协议的用户标识,如果没有指定返回null
        /// </summary>
        public string GetFlg
        {
            get
            {
                if (Protocol == null)
                {
                    return null;
                }
                return Protocol.UserFlag;
            }
        }

        /// <summary>
        /// 这条指令是何 数据同步节点发送过来的
        /// </summary>
        public SyncPoint Client { get; set; }

        /// <summary>
        /// 所属数据池,可以为null
        /// </summary>
        public IPool Pool { get; set; }
    }
}
